﻿@model LogisticsPackageModel
@using Nop.Admin.Models.Logistics;

@{
    var gridPageSize = EngineContext.Current.Resolve<Nop.Core.Domain.Common.AdminAreaSettings>().GridPageSize;

    //page title
    ViewBag.Title = T("Admin.Logistics.PackageEdit.Title").Text;
}

@using (Html.BeginForm(null, null, FormMethod.Post, new { id = "package-form" }))
{
    <div class="section-header">
        <div class="title">
            <img src="@Url.Content("~/subsites/Administration/Content/images/ico-configuration.png")" alt="" />
            <span>@T("Admin.Logistics.PackageEdit.Title") - @Model.Id</span> @Html.ActionLink("(" + T("Admin.Logistics.PackageList.BackToList") + ")", "PackageList")
            @if (Model.PlanId.HasValue && Model.PlanId.Value > 0)
            {
                @Html.ActionLink("(" + T("Admin.Logistics.PackageEdit.BackToPlannedRoute") + ")", "PlannedRouteList", new { id = Model.PlanId.Value })
                @Html.ActionLink("(" + T("Admin.Logistics.PackageEdit.BackToRoutePlanning") + ")", "RoutePlanning", new { id = Model.PlanId.Value })
            }
            else
            {
                @Html.ActionLink("(" + T("Admin.Logistics.PackageEdit.BackToCreatePlan") + ")", "PlanningOverview")
            }
        </div>

        <div class="options">
            <input type="submit" name="save" class="t-button" value="@T("Admin.Common.Save")" />
            <input type="submit" name="save-continue" class="t-button" value="@T("Admin.Common.SaveContinue")" />
            @Html.ActionLink(T("Admin.Logistics.PrintPackagingSlip").Text, "PrintPackageWaybillAsPdf", "Logistics", new { id = Model.Id }, new { @class = "button-grey t-button", target = "_blank" })
            <a href="@Url.Action("UndoPackageShipped", new { id = Model.Id })" class="t-button">@T("Admin.Logistics.PackageEdit.UndoPackageShipped")</a>
            <a href="@Url.Action("UndoPackageDelivery", new { id = Model.Id })" class="t-button">@T("Admin.Logistics.PackageEdit.UndoPackageDelivery")</a>
        </div>
    </div>

    @Html.Partial("_CreateOrUpdate", Model)
}
